<template>
  <div>
    <el-card>
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item>会员管理</el-breadcrumb-item>
        <el-breadcrumb-item>储存规则</el-breadcrumb-item>
      </el-breadcrumb>
      <h3>储存规则</h3>
    </el-card>

    <el-card>
      <span>基础规则</span>
      <!-- sendform -->
      <el-form :model="sendForm" size="medium" label-width="122px">
        <!-- 最小储存单位 -->
        <el-col :span="20" id="box">
          <el-form-item label="最小储存单位">
            <el-input  style="width:200px" placeholder="请输入内容" v-model="sendForm.input2">
              <template slot="append">分</template>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="20" id="box1">
          <el-form-item label="可用对象">
            <el-checkbox label="普通会员" v-model="checkedBox"></el-checkbox>
          </el-form-item>
        </el-col>
        <el-col :span="20" id="box2">
          <el-form-item>
            <el-checkbox label="付费会员" v-model="checkedBox"></el-checkbox>
          </el-form-item>
        </el-col>
      </el-form>
    </el-card>
    
    <el-card id="chongzhi">
      <span>充值规则</span>
      <!-- sendFormA -->
      <el-form :model="sendFormA" size="medium" label-width="133px">
        <!-- 余额限制 -->
        <el-col :span="20" id="box">
          <el-form-item label="余额限制">
            <el-checkbox label="最多金额" v-model="checkedBox"></el-checkbox>
            <el-input style="width:200px;margin-left:30px" placeholder="请输入" v-model="sendFormA.input3">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 单次充值金额限制 -->
        <el-col :span="20" id="box1">  
          <el-form-item label="单次充值金额限制">
            <el-checkbox label="最多充值" v-model="checkedBox"></el-checkbox>
            <el-input style="width:200px;margin-left:30px" placeholder="请输入" v-model="sendFormA.input4">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="20" id="box1">
          <el-form-item>
            <el-checkbox label="最少充值" v-model="checkedBox"></el-checkbox>
            <el-input style="width:200px;margin-left:30px" placeholder="请输入" v-model="sendFormA.input5">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="20" id="box1">
          <el-form-item label="充值方式">
            <el-checkbox label="会员APP充值" v-model="checkedBox"></el-checkbox>
          </el-form-item>
        </el-col>
        <el-col :span="20" id="box1">
          <el-form-item>
            <el-checkbox label="商家后台充值"  v-model="checkedBox"></el-checkbox>
          </el-form-item>
        </el-col>
      </el-form>
    </el-card>

    <el-card>
      <span>充值规则</span>
      <!-- sendform2 -->
      <el-form size="medium" label-width="128px">
        <el-col :span="20" id="box1">
          <el-form-item>
            <span id="span1">余额可用商品</span>
            <el-radio v-model="radio" label="1">全部商品</el-radio>
            <el-radio v-model="radio" label="2">部分商品</el-radio>
            <span>选择商品</span>
          </el-form-item>
        </el-col>
        <el-col :span="20" id="box1">
          <!-- <el-form-item label="单次充值金额限制">
            <el-checkbox v-model="checked">最多使用</el-checkbox>
            <el-input style="width:200px;margin-left:30px" placeholder="请输入" v-model="input66">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>-->
          <el-form-item>
            <el-checkbox v-model="sendForm.checked8">最多使用</el-checkbox>
            <el-input style="width:200px;margin-left:30px" placeholder="请输入" v-model="sendForm.input66">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="20" id="box1">
          <el-form-item>
            <el-checkbox v-model="sendForm.checked9">最少使用</el-checkbox>
            <el-input style="width:200px;margin-left:30px" placeholder="请输入" v-model="sendForm.input77">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="20" id="box1">
        <el-form-item id="box5">
          <el-button type="primary" @click="send">提交</el-button>
        </el-form-item>
        </el-col>
      </el-form>
    </el-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      sendForm:{
          input2: "",
          checked1:"",
          checked2:""
          
          // checked8:"",
          // checked9:""
      },
      sendFormA:{
          checked3:"",
          checked4:"",
          checked5:"",
          checked6:"",
          checked7:"",
          input3:"",
          input4:"",
          input5:""
      },
      checkedBox:[],
      radio: "1",
      
      
    }; 
  },
  methods:{
     send(){
      this.$axios({
         url:'/vip/storedValue/add',
         params:{
           minStore:this.sendForm.input2,
           object:[this.checkedBox[0],this.checkedBox[1]].join(','),
           
           balanceLimit:[this.sendFormA.checked3,this.sendFormA.input3].join(','),
           minRecharge:[this.sendFormA.checked5,this.sendFormA.input5].join(','),
           maxRecharge:[this.sendFormA.checked4,this.sendFormA.input4].join(','),
           way:[this.sendFormA.checked6,this.sendFormA.checked7].join(',')
         }
       }).then((res)=>{
         if(res.data.code==0){
             this.$message.info('提交成功')
             this.$router.push("/home/userRights");
         }
       }).catch((err)=>{
         console.log(err)
       })
      
      console.log(this.checkedBox[0],this.checkedBox[1]);
      
       
       
     }
     
  }
};
</script>
<style lang="less" scoped>
#inp1 {
  width: 100px;
}
#box {
  margin-top: 20px;
  margin-left: 250px;
}
#box1,
#box2 {
  margin-left: 250px;
}
#span1 {
  margin-left: -96px;
}
.el-radio {
  margin-left: 20px;
}
#box5 {
  margin-left: 250px;
}
#chongzhi {
  margin-top: 20px;
}
</style>